package com.app.view.component.dialogs.createRoom 
{
	import flash.text.TextField;
	import flash.events.MouseEvent;
	
	import org.component.item.ListItem;
	
	/**
	 * ...
	 * @author kevin
	 */
	public class MinPourListItem extends ListItem
	{
		private var _label:TextField = null;
		
		public function MinPourListItem(ui:MovieClip = null) 
		{
			super(ui);
		}
		
		override protected function initialization():void 
		{
			super.initialization();
		}
		
		override protected function configEventListeners():void 
		{
			super.configEventListeners();
			
			assest.doubleClickEnabled = true;
			assest.addEventListener(MouseEvent.ROLL_OVER, onAssestOver);
			assest.addEventListener(MouseEvent.ROLL_OUT, onAssestOut);
			assest.addEventListener(MouseEvent.CLICK, onAssestClick);
		}
		
		private function onAssestOver(event:MouseEvent):void
		{
			if (select) return;
			//assest.gotoAndStop(2);
		}
		private function onAssestOut(event:MouseEvent):void
		{
			if (select) return;
			//assest.gotoAndStop(1);
		}
		
		private function onAssestClick(event:MouseEvent):void
		{
			_subject.dispatchEvent(event);
		}
		
		override public function update(data:String = ''):void 
		{
			assest["label"].text = data;
		}
		
		override public function get select():Boolean { return super.select; }
		
		override public function set select(value:Boolean):void 
		{
			super.select = value;
			
			if (value)
			{
				assest.gotoAndStop(3);
			}else
			{
				assest.gotoAndStop(1);
			}
		}		
	}

}